<?php if ( ! defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
	//require( 'blog_model.php' );
	$a = ( !empty( $_POST['a'] ) ) ? $_POST['a'] : "pic";
	$html = " ";

	if( $a == "pic" ) {
		$data = array_keys( $pic );
		for( $i = 0; $i < count( $data ); $i++) {
				if( $i > 0) $html .= ",";
				$html .= "'".$data[$i]."'";
		}
		$html = "[".$html."]";
	}
	else {
		$p = ( !empty( $_POST['p'] ) ) ? $_POST['p'] : false;
		$data = fetch_records( $p );
		foreach( $data as $key => $value ) {
				$html .= "{'code':'".$key."','name':'".$value."'},";
		}
		$html = "[".substr($html,0,-1)."]";
	}

echo $html;